package cn.kgc.hotel.service.impl;

import cn.kgc.hotel.dao.UserMapper;
import cn.kgc.hotel.entity.Param.UserParam;
import cn.kgc.hotel.entity.User;
import cn.kgc.hotel.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource UserMapper userMapper;

    @Override
    public List<User> showUser(UserParam userShowParam) {
        List<User> users = userMapper.showUser(userShowParam);
        return users;
    }

    @Override
    public boolean addUser(UserParam userParam) {
        int i = userMapper.addUser(userParam);
        if(i>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean updateUser(UserParam userParam) {
        int i = userMapper.update(userParam);
        if(i>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean deleteUser(UserParam userParam) {
        int i = userMapper.deleteUser(userParam);
        if(i>0){
            return true;
        }
        return false;
    }
}
